package com.joymart.protocol.repo;

import com.joymart.common.data.jdbc.BaseRepository;
import com.joymart.protocol.model.Protocol;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Repository;

@Repository
public interface ProtocolRepository extends BaseRepository<Protocol,String> {

    @Nullable
    @Query("select * from protocol where type = :type order by created_at desc limit 1")
    Protocol findLatestByType(String type);

}
